package com.wingsofts.myapplication

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_user_center.*

class UserCenterActivity : AppCompatActivity() {
    private lateinit var dialog: AlertDialog
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_user_center)
        td_avatar.setTouchMode(ThreeDLayout.MODE_BOTH_X_Y)
        td_avatar.setMaxRotateDegree(30)
        dialog = AlertDialog.Builder(this).setMessage("refreshing....").create()
    }

    fun refresh(view: View?) {
        dialog.show()
        td_root.startHorizontalAnimate()
        Thread(Runnable {
            try {
                Thread.sleep(3000)
            } catch (e: InterruptedException) {
                e.printStackTrace()
            }
            runOnUiThread {
                dialog.dismiss()
                td_root.stopAnimate()
            }
        }).start()
    }
}